Skip to content

fix(ci): repair the SSO locators #33575 dropped, and stop SearchIndexRetryQueueIT racing the app's retry worker - #33646

Merged
harshach merged 2 commits into
mainfrom
harshach/fix-sso-locators-and-retry-queue-isolation
Sep 20, 2026
Merged

harshach merged 2 commits into
mainfrom
harshach/fix-sso-locators-and-retry-queue-isolation

Conversation

@harshach

@harshach harshach commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #33647

Three CI checks currently fail. None of them is caused by the code under test — two are
Playwright locators that a merged UI migration invalidated, and one is an integration test
racing a background worker the application starts. They were found on #33631 but are
properties of main, so they are fixed here on their own.

Type of change:

  • Bug fix

High-level design:

1. fix(e2e) — two selectors that #33575 deleted.

#33575 migrated the
unauthenticated screens to @openmetadata/ui-core-components. It updated the Playwright
helpers the PR lane runs (Login.spec.ts, UserClass.ts, admin.ts, user.ts) but not the
SSO ones, which only execute in the nightly matrix — so both breakages merged green.

Selector What happened Fix
button.signin-button LoginButton swapped antd for the core Button, replacing className="signin-button m-x-auto" with Tailwind utilities. The class now exists nowhere in src/ — grep -r signin-button src/ returns nothing — so the locator matches nothing. getByTestId('sso-login-button'), which the component already carries and core Button spreads onto the real <button>. 4 call sites.
full-name-input The signup field is now a core Input; its react-aria TextField puts the test id on the wrapper <div data-input-wrapper>, not on the control, so fill() throws "Element is not an <input>". getByTestId('full-name-input').locator('input') — the convention the rest of the corpus already uses for these wrappers (lineage.ts, glossary.ts, dataQuality.ts), and the one SignUpPage.test.tsx already relies on via .querySelector('input').

I swept #33575's whole diff for other casualties: every other data-testid it removed
(bg-image, brand-image, confirm-password, email, email-input, email-label,
full-name-label, password, username-label) and every non-Tailwind class it removed. The
only Playwright references left pointing at something that no longer exists are the five fixed
here; the email / email-input hits are on authenticated screens this PR did not touch.

2. test(it) — SearchIndexRetryQueueIT races the always-on retry worker.

java.util.NoSuchElementException: No value present
  at SearchIndexRetryQueueIT.java:446

testUpdateFailureAndRetryCountIncrementsCountAndRetainsAttemptTime writes a row, moves it
back to PENDING, reads PENDING back, and expects to find it. The row is gone because
OpenMetadataApplication registers an always-on SearchIndexRetryWorker — four threads
polling the shared search_index_retry_queue table every five seconds — and claimPending()
takes every row it finds in PENDING / PENDING_RETRY_1 / PENDING_RETRY_2, flipping it to
IN_PROGRESS and deleting it once processed. It lands in the window between the write and the
read.

The failing CI log shows it directly: Started search index retry worker with 4 consumer threads at 01:12:50, before the class begins, with the matching Stopped only at Dropwizard
shutdown at 01:13:37 — live for every test in between.

It is worth saying what this is not. It is not a load problem, and the LIMIT 1000 on the
read is not the cause: the retry-queue lane runs this class and nothing else, the class is
@Execution(SAME_THREAD), and @BeforeEach truncates the queue — so no second writer can push
the row past the cap in the 23 ms the test took.

The class has already been patched for this same worker twice, each time around a single
symptom — one test picks statuses "that the background SearchIndexRetryWorker does not
claim"
, another counts a row as handled by "ANY worker … or the always-on application worker
sharing the global queue"
. Roughly half the DAO-level tests still assert on rows in a claimable
status and are racing it the same way; this one just lost the race first. So this fixes the
cause: pause that worker for the duration of the class, restart it in @AfterAll.

Nothing here depends on it running — the six worker tests construct and start their own worker,
and the DAO-level tests want no worker at all. TestSuiteBootstrap.findManagedObject unwraps
Dropwizard's JettyManaged to reach the instance the application built; it returns an
Optional and the caller fails loudly if the worker is ever absent, rather than silently going
back to racing one.

Backward compatibility / migration: none. Test-only — no production source, schema or
bootstrap/sql change.

Tests:

Use cases covered

  • Keycloak OIDC (public) SSO: login, logout, multi-tab auth state, expired-token cold load,
    silent refresh — all five reach the signup screen and fill the display name.
  • Keycloak Azure SAML: session-limit eviction asserts the evicted tab lands logged out.
  • SearchIndexRetryQueueIT: all 35 tests, deterministic rather than dependent on whether the
    application worker happens to poll inside the window.

Backend integration tests

  • No new ITs — this changes test isolation, not behaviour. The regression guard is the lane
    itself: -DintegrationTests.lane=retry-queue runs SearchIndexRetryQueueIT alone against a
    real server, which is exactly the configuration that was failing.

Playwright (UI) tests

  • No new specs — the fix is to locators inside existing ones. Both legs run automatically on
    this PR: it touches playwright/e2e/Auth/** and playwright/utils/sso-providers/**, which
    are on the SSO Login Nightly pull_request trigger.

Verification performed

Every claim above was checked against the tree rather than assumed:

Claim How it was checked
signin-button no longer exists grep -r signin-button over src/ — zero hits; only the 4 Playwright call sites
sso-login-button reaches a real <button> LoginButton.tsx sets it; core button.tsx spreads ...otherProps onto AriaButton
the test id sits on the signup wrapper input.tsx's TextField spreads props onto AriaTextField + data-input-wrapper; matches the <div …> in the CI error
.locator('input') is the house convention 8+ existing call sites, plus SignUpPage.test.tsx's .querySelector('input')
the application worker is live during the IT OpenMetadataApplication.java:468 registers it; CI log start/stop timestamps bracket the whole class
the lane has no other writer pom: retryQueueTests = SearchIndexRetryQueueIT; excluded from the parallel execution; parallel.enabled=false
the Dropwizard API used exists and is public javap on dropwizard-lifecycle:5.0.0 / dropwizard-core:5.0.0: LifecycleEnvironment#getManagedObjects(), JettyManaged#getManaged(), Environment#lifecycle(), DropwizardAppExtension#getEnvironment()
formatting google-java-format (GOOGLE style, javadoc formatting off) reports both Java files clean; prettier@2.8.8 reports all five TS files clean

I could not execute either suite in my sandbox — the SSO legs need the Keycloak/OM docker stack
and the IT lane needs testcontainers, neither of which runs there. CI on this PR is the
execution, and it exercises both.

Is this failing on main too?

Yes for SSO, by construction: main carries #33575 and neither locator fix, and the class the
tests look for is not in the tree. (A workflow_dispatch of SSO Login Nightly on main is
easy to misread here — its sso_provider input defaults to okta, so both keycloak legs report
green having been skipped, not run.)

The retry-queue failure is on main too — SearchIndexRetryQueueIT is byte-identical on main
and on the branch it was seen on. It is timing-dependent, so a single green main run neither
confirms nor clears it; the interleaving that produces it is what the diagnosis above pins down.

UI screen recording / screenshots:

Not applicable — no production UI code changes, only Playwright selectors.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR is a bug fix to CI; there is no issue to link.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable — no schema touched.
  • For UI changes: not applicable — no production UI code touched.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the new locators match the migrated DOM and the retry-worker lifecycle change correctly isolates the dedicated integration-test lane.

Summary

This PR repairs SSO Playwright locators invalidated by the core-component migration and isolates retry-queue integration tests from the application’s background retry worker.

  • Replaces the removed signin-button class selector with the existing sso-login-button test ID.
  • Targets the inner input beneath the core Input wrapper when completing Keycloak self-signup.
  • Adds managed-object discovery to the integration-test bootstrap.
  • Stops the application retry worker for SearchIndexRetryQueueIT and restarts it after the class.
Diagram
sequenceDiagram
  participant JUnit as SearchIndexRetryQueueIT
  participant Bootstrap as TestSuiteBootstrap
  participant AppWorker as Application Retry Worker
  participant TestWorker as Test-owned Retry Worker

  JUnit->>Bootstrap: findManagedObject(SearchIndexRetryWorker)
  Bootstrap-->>JUnit: managed application worker
  JUnit->>AppWorker: stop()
  loop Retry-queue tests
    JUnit->>JUnit: exercise DAO operations
    opt Worker behavior test
      JUnit->>TestWorker: start()
      TestWorker->>TestWorker: process test queue records
      JUnit->>TestWorker: stop()
    end
  end
  JUnit->>AppWorker: start()
Loading

Reviews (1) · Last reviewed commit: "test(it): pause the application's retry ..."

harshach and others added 2 commits September 20, 2026 01:45
…ation

#33575 migrated the unauthenticated screens to `@openmetadata/ui-core-components`
and took two selectors with it. It updated the Playwright helpers the PR lane
runs, but not the SSO ones, which only execute in the nightly matrix -- so both
breakages landed green and surface as nightly/PR failures now.

1. `button.signin-button`. `LoginButton` swapped antd for the core `Button` and
   `className="signin-button m-x-auto"` for Tailwind utilities, so that class
   exists nowhere in `src/` any more and the locator matches nothing:

       expect(locator).toBeVisible() failed
       Locator: locator('button.signin-button')
       Error: element(s) not found

   The component carries `data-testid="sso-login-button"`, which core `Button`
   spreads onto the real `<button>`, so use that at all four call sites. This is
   what fails SSOSessionLimit "should evict the least-recently-used session once
   the cap is exceeded": the `waitForURL('**/signin')` before it passes --
   eviction works -- and only the button assertion after it breaks.

2. `full-name-input`. The signup screen now builds that field from the core
   `Input`, whose react-aria `TextField` puts the test id on the wrapper
   `<div data-input-wrapper>` rather than on the control, so `fill()` throws:

       locator.fill: Element is not an <input>, <textarea>, <select> ...
       locator resolved to <div data-rac data-input-wrapper="true"
                                data-testid="full-name-input" ...>

   Reach the control the way the rest of the corpus already does for these
   wrappers (`getByTestId(...).locator('input')`, as in lineage.ts, glossary.ts
   and dataQuality.ts), which also keeps the test id where SignUpPage.test.tsx's
   `.querySelector('input')` expects it. This is what fails all five
   keycloak-oidc-public scenarios; the `inputValue().catch(() => '')` above the
   fill swallowed the same error first, which is why it surfaced one line later
   as a confusing fill() error rather than where the locator went wrong.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ueIT

`testUpdateFailureAndRetryCountIncrementsCountAndRetainsAttemptTime` fails
intermittently on the retry-queue lane:

    java.util.NoSuchElementException: No value present
      at SearchIndexRetryQueueIT.java:446

The test writes a row, moves it back to PENDING, reads PENDING back and expects
to find it. The row is gone because `OpenMetadataApplication` registers an
always-on `SearchIndexRetryWorker` -- four threads polling the shared
`search_index_retry_queue` table every five seconds -- and `claimPending()`
takes *every* row it finds in PENDING / PENDING_RETRY_1 / PENDING_RETRY_2,
flipping it to IN_PROGRESS and deleting it once processed. It lands in the
window between the write and the read.

The CI log shows it plainly: "Started search index retry worker with 4 consumer
threads" at 01:12:50, before the class begins, and the matching "Stopped" only
at Dropwizard shutdown at 01:13:37 -- so the application worker was live for
every test in between.

This is not a load problem, and the `LIMIT 1000` on the read is not the cause:
the retry-queue lane runs this class and nothing else, the class is
`SAME_THREAD`, and `@BeforeEach` truncates the queue, so there is no second
writer that could push the row past the cap in the 23ms the test took.

The class has been patched for this same worker twice before -- one test picks
statuses "that the background SearchIndexRetryWorker does not claim", another
counts a row as handled by "ANY worker ... or the always-on application worker
sharing the global queue" -- so fix the cause instead of the next symptom:
pause that worker for the duration of the class and restart it afterwards.
Nothing here depends on it running. The six worker tests construct and start
their own worker, and the DAO-level tests want no worker at all; roughly half of
them assert on rows in a claimable status and were racing it the same way.

`TestSuiteBootstrap.findManagedObject` unwraps Dropwizard's `JettyManaged` to
reach the instance the application built. It returns `Optional`, and the caller
fails loudly if the worker is absent rather than silently going back to racing
one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Sep 20, 2026
@gitar-bot

gitar-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk

Repairs two SSO Playwright locators invalidated by the core-components migration (#33575) and eliminates a race condition in SearchIndexRetryQueueIT by pausing the application's retry worker for the duration of the test class. No issues found.

Review coverage

Rules No rules evaluated

Functional validation Not enabled · Set up

Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit e7d07774b56a1784cc7d60d0eec2c89277ce448e in Playwright run 35482303093, attempt 1.

✅ 4538 passed · ❌ 0 failed · 🟡 7 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 50m 44s

⏱️ Max setup 4m 48s · max shard execution 23m 39s · max shard-job elapsed before upload 26m 47s · reporting 18s

🌐 225.39 requests/attempt · 2.23 app boots/UI scenario · 41.51% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 41.51% (convergence target: at most 15%).
  • Browser traffic was 225.39 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.23 per UI scenario (10778 boots / 4838 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 130 0 0 0 0 0
✅ Shard chromium-01 186 0 0 0 0 0
✅ Shard chromium-02 175 0 0 0 0 0
✅ Shard chromium-03 217 0 0 0 0 0
✅ Shard chromium-04 175 0 0 0 0 0
🟡 Shard chromium-05 179 0 3 0 0 0
✅ Shard chromium-06 146 0 0 0 0 0
✅ Shard chromium-07 179 0 0 0 0 0
✅ Shard chromium-08 167 0 0 0 0 0
✅ Shard chromium-09 169 0 0 0 0 0
✅ Shard chromium-10 185 0 0 0 0 0
✅ Shard chromium-11 196 0 0 0 0 0
✅ Shard chromium-12 190 0 0 1 0 0
🟡 Shard chromium-13 195 0 2 0 0 0
✅ Shard chromium-14 201 0 0 0 0 0
🟡 Shard chromium-15 194 0 1 0 0 0
✅ Shard chromium-16 196 0 0 0 0 0
✅ Shard chromium-17 140 0 0 0 0 0
✅ Shard chromium-18 188 0 0 0 0 0
🟡 Shard chromium-19 163 0 1 0 0 0
✅ Shard chromium-20 154 0 0 0 0 0
✅ Shard chromium-21 200 0 0 0 0 0
✅ Shard chromium-22 168 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 80 0 0 0 0 0
✅ Shard import-export-02 70 0 0 0 0 0
✅ Shard ingestion-01 46 0 0 0 0 0
✅ Shard ingestion-02 53 0 0 0 0 0
✅ Shard reindex-01 40 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 7 flaky test(s) (passed on retry)
  • Features/Glossary/GlossaryMutualExclusivityDataProductTree.spec.ts › ME-R01: Children of ME parent should render Radio buttons (shard chromium-05, 1 retry)
  • Features/Glossary/GlossaryMutualExclusivityDataProductTree.spec.ts › ME-R02: Children of non-ME parent should render Checkboxes (shard chromium-05, 1 retry)
  • Features/Glossary/GlossaryMutualExclusivityDataProductTree.spec.ts › ME-S03: Can deselect currently selected ME term (shard chromium-05, 1 retry)
  • Pages/Domains.spec.ts › Subdomain rename does not affect parent domain and updates nested children (shard chromium-13, 1 retry)
  • Pages/GlossaryFormValidation.spec.ts › should show error when glossary name is empty (shard chromium-13, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard chromium-15, 1 retry)
  • Features/AccessControlSettings.spec.ts › should show all 4 landing cards and navigate to each panel (shard chromium-19, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@harshach
harshach merged commit 83adea9 into main Sep 20, 2026
157 of 161 checks passed
@harshach
harshach deleted the harshach/fix-sso-locators-and-retry-queue-isolation branch September 20, 2026 04:07
harshach added a commit that referenced this pull request Sep 20, 2026
Three conflicts, one hunk each, all resolved keeping both sides' intent:

- SSOSessionLimit.spec.ts: both sides had already converged on
  getByTestId('sso-login-button') -- #33646 landed the same fix on main --
  so the only conflict was this branch's waitUntil: 'domcontentloaded'
  hardening. Kept it; the unconflicted survivor.reload() two lines below
  uses the same pattern.

- SearchIndexRetryQueueIT.java: kept this branch's Isolated import. main
  never had @isolated -- it stops the worker race with
  pauseApplicationRetryWorker() instead -- but the annotation survives in
  the merged body, so dropping the import would not compile. The two
  guards are complementary, not alternatives.

- TestSuiteBootstrap.java: took main's Managed import. Its new
  findManagedObject(Class<T>) declares <T extends Managed> and merged in,
  so the import is load-bearing.

Verified: no conflict markers in the tree, spotless:check passes on
openmetadata-integration-tests, prettier and eslint clean on the resolved
spec, and the corpus still enumerates 4667 tests in 407 files.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
timothybrush pushed a commit to timothybrush/OpenMetadata that referenced this pull request Sep 20, 2026
… primitives (open-metadata#33651)

* ci(sso): extend PR-lane paths to login/signup pages and the core Button/Input primitives

The SSO nightly's `pull_request` paths already trigger on the SSO
fixtures, the AuthCoordinator/AuthProvider surface, and the backend
auth handlers — but NOT on the login/signup pages themselves nor on
the `@openmetadata/ui-core-components` primitives those pages render.

That gap let open-metadata#33575 (antd → core-components migration for the
unauthenticated screens) merge green: its own Playwright lane only
ran non-SSO specs, and the SSO fixtures — which live in a
nightly-only lane — never executed. The migration dropped the
`.signin-button` class the fixtures selected on, and moved the
`full-name-input` testid onto a wrapper `<div>` so `.fill()` threw.
Both broke as soon as the nightly ran; open-metadata#33646 fixed the locators
after the fact.

Adding these paths brings the SSO matrix into any PR that touches:
  - `pages/{LoginPage,SignUp,ForgotPassword,ResetPassword}/**` —
    the actual auth screens the fixtures drive.
  - `components/common/LoginButton/**` — the sign-in button whose
    DOM shape the fixture depends on.
  - `ui-core-components/.../base/{buttons,input}/**` — the shared
    primitives that emit the DOM the fixtures select on (this is the
    cross-package breakage open-metadata#33575 was — catching it on the
    originating PR is the whole point of this change).
  - `playwright/utils/ssoLogin.ts` — belt-and-braces so an edit to
    the fixture helper itself always runs the matrix.

Every provider fixture still self-gates on `isAvailable()` via
required secrets, so fork PRs without live-tenant credentials
short-circuit cleanly per leg — the added paths don't turn Okta or
Keycloak-crosssite into hard failures on the PR lane.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci(sso): extend PR-lane paths to form / form-field primitives

Greptile r4056182832: the Basic and LDAP fixtures locate inputs via
`getByLabel(/email/i)` and `getByLabel(/password/i)` — labels emitted
from `components/base/form/**` and `components/application/form-field/
render-field-element.tsx`. A migration that reshapes those wrappers
can invalidate the same fixtures the Button/Input paths already cover,
so they belong on the same trigger.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: SSO nightly legs broken by the core-components migration, and SearchIndexRetryQueueIT races the app's retry worker

1 participant